package cn.bonoon.kernel.support.services.handler;

import javax.persistence.EntityManager;

import cn.bonoon.kernel.events.OperateEvent;
import cn.bonoon.kernel.support.entities.EntityDeletable;
import cn.bonoon.kernel.support.entities.Persistable;

public class DeleteDeletableHander implements DeleteHandler{
	
	@Override
	public void handler(EntityManager entityManager, OperateEvent event, Persistable entity) {
		((EntityDeletable)entity).setDeleted(true);
		entityManager.merge(entity);
	}
}
